package com.tuanzi.loan.vo.response.product.product;

import java.util.Date;

import org.joda.time.DateTime;

import com.tuanzi.loan.core.vo.IdentityResponse;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author Ray 2017/09/21
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class LoanProductInfoSearchResponse extends IdentityResponse {

	private String name;

	private String logo;

	private Integer position;

	private Integer status;

	private String remark;

	private String updator;

	private Date updateTime;

	private Date createTime;

	private Integer autoOnline;

	private Integer dailyClickUvLimitation;

	private Integer dailyClickUvRemaining;

	private Integer autoOnlineTime;

	private String type;

	private String large_products;

	public Date getProductAutoOnlineTimeDisplay() {
		if (autoOnlineTime != null) {
			DateTime now = DateTime.now();
			return new DateTime(now.getYear(), now.getMonthOfYear(), now.getDayOfMonth(), 0, 0, 0).plusSeconds(autoOnlineTime).toDate();
		}
		return null;
	}

}
